#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
//在main()函数中测试display函数模板
using namespace std;
//函数模板的原型


int main(int argc, char** argv) {
      //声明变量
    char c='A';
    char str[]="This is a test";
    int n=10;
    float x=1.5;
    double z=3.1415926;

    //两个参数类型相同
    display(c, char(c+2));
    display(str, str);
    display(n, 2*n);
    display(x,2*x);
    display(z, 2*z);
    cout<<"------------------"<<endl;

    //两个参数类型不同
    display(c, str);
    display(str, c);
    display(n, str);
    display(str,2*x);
    display(z, n);
    return 0;
}
template <class T1, class T2> void display(T1 x, T2 y);




//定义名为display的函数模板
template <class T1, class T2> void display(T1 x, T2 y)
{
    cout << x << " " << y << endl;